<?xml version="1.0" encoding="ISO-8859-1" ?>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 <style type="text/css">
@import "<%=request.getContextPath() %>/js/dijit/themes/soria/soria.css";
@import "<%=request.getContextPath() %>/js/dijit/themes/tundra/tundra.css";
@import "<%=request.getContextPath() %>/js/dojox/grid/resources/Grid.css";
@import "<%=request.getContextPath() %>/js/dojox/grid/resources/tundraGrid.css";
@import "<%=request.getContextPath() %>/js/dojox/grid/enhanced/resources/tundraEnhancedGrid.css";
@import "<%=request.getContextPath() %>/js/dojox/grid/enhanced/resources/EnhancedGrid_rtl.css";
.dojoxGrid table { margin: 0; } html, body { width: 100%; height: 100%;
            margin: 0; }
</style>
<script type="text/javascript">
dojo.require("dojox.grid.DataGrid");
dojo.require("dojo.parser");
dojo.require("dijit.form.Button");
dojo.require("dijit.form.TextBox");
dojo.require("dijit.form.DateTextBox");
dojo.require("dijit.form.ComboBox");
dojo.require("dijit.layout.ContentPane");
dojo.require("dijit.layout.TabContainer");
dojo.require("dojox.data.QueryReadStore");
dojo.require("dijit.TitlePane");
dojo.require("dijit.Toolbar");
dojo.require("dojox.grid.EnhancedGrid");
dojo.require("dojox.grid.enhanced.plugins.DnD");
dojo.require("dojox.grid.enhanced.plugins.Menu");
dojo.require("dojox.grid.enhanced.plugins.NestedSorting");
dojo.require("dojox.grid.enhanced.plugins.IndirectSelection");

var layout = [{
                    field: 'Description',
                    name: 'Description',
                    width: '200px'
                },
                {
                    field: 'Item',
                    name: 'Item',
                    width: '200px'
                }];

</script>
<div dojoType="dijit.Toolbar">
	<span dojoType="dijit.form.Button" onClick="dijit.byId('loadDiv').href='<%=request.getContextPath() %>/createInventory.htm';dijit.byId('loadDiv').show(); return false;">
        <span>New</span>
    </span>
    <span dojoType="dijit.form.Button">
        <span>Delete</span>
    </span>
    <span dojoType="dijit.form.Button">
        <span>Help</span>
    </span>    
</div>
<br/>
<div dojoType="dijit.TitlePane" title="<b>Inventory</b>" style="height:80%;" >
	<!-- Data stores read data from a data store such as a servlet -->
	<div dojoType="dojox.data.QueryReadStore" jsId="itemStore" 	url="listInventory.htm">
    </div>

	<!-- A grid displays data and offer useful operations such as client sorting -->
	<div id="grid" dojoType="dojox.grid.EnhancedGrid" structure="layout" store="itemStore" style="height:80%;"
	plugins="{nestedSorting: true, dnd: true, indirectSelection: true}" rowSelector="0px">
    </div>
</div>
<div id="response"></div>
<script>
dojo.addOnLoad(function(){
	var dialog = dijit.byId('loadDiv');
	dialog.reset();
	dialog.titleNode.innerHTML = 'New Inventory';
});
</script>
